package com.dianxin.smartpark.service.config;

import com.dianxin.smartpark.api.cons.PassPersonType;

public enum MqttOptType {
    /**
     * 操作类型
     */
    ADDUSERFACE(100100,"新增人脸"),
    UPDATEUSERFACE(100101,"修改人脸"),
    DELUSERFACE(100102,"删除人脸"),

    ADDUSERCARD(101100, "新增IC卡"),
    DELUSERCARD(101101, "删除IC卡"),

    ADDUSERCAR(101110, "新增车牌"),
    DELUSERCAR(101111, "删除车牌"),;


    private final String optNmae;
    private final Integer optCode;


    MqttOptType(int optCode, String optNmae) {
        this.optNmae = optNmae;
        this.optCode = optCode;
    }

    public String getOptNmae() {
        return optNmae;
    }

    public Integer getOptCode() {
        return optCode;
    }

    public static Integer mqttOptType(String optNmae) {
        if (optNmae == null) {
            return null;
        }
        for (MqttOptType value : MqttOptType.values()) {

            if (value.optNmae.equals(optNmae)) {
                return value.optCode;
            }
        }
        return null;
    }


}
